<!-- 快捷键，!+回车，自动生成html框架 -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录-小滴服务</title>
    <!-- 引入公共样式 -->
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/common.css">
    <style>
        /* 标签选择器 */
        p{
            text-align: center;
        }
        ul{
            padding: 0 40px;
            margin:50px 0 20px 0;
        }
        ul li input{
            height: 45px;
            width: 100%;
            padding: 0 15px;
            /* ie盒子模型 */
            box-sizing: border-box;
            border: 1px solid #DCDCDD;
        }
        ul li input.username{
            border-radius: 10px 10px 0 0;
        }
        ul li input.password{
            border-radius: 0 0 10px 10px;
        }
        .btn{
            padding: 0 40px;
        }
        button{
            height: 40px;
            text-align: center;
            width: 100%;
            background-color: #1C6DC0;
            color: white;
            font-size: 18px;
            border: none;
        }
    </style>
</head>
<body>
    <header>登录</header>
    <p class="mt70">
        <img src="./imgs/head.png" alt="">
    </p>
    <ul>
        <li>
            <input class="username" type="text" placeholder="请输入用户名">
        </li>
        <li>
            <input class="password" type="password" placeholder="请输入密码">
        </li>
    </ul>
    <p class="btn">
        <button id="loginBtn">登录</button>
    </p>
    <script src="./js/jquery.min.js"></script>
    <script>
        //添加点击事件
        loginBtn.onclick = function(){
            //调用接口，校验登录逻辑
            $.ajax({
                url:"/api/login.json",
                success(r){
                    console.log(r);
                    alert("欢迎"+r.username+"回来！");
                    //跳转
                    location.href="./index.html";
                }
            })
            
        }
    </script>
</body>
</html>